<?php
//$client = new swoole_client(SWOOLE_SOCK_TCP);//创建swoole tcp客户端
$client = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP); //协程客户端
$client->connect('127.0.0.1', 9509, 30) or die("连接失败");//连接server

for($i=1;$i<200;$i++){
    $sql = "select * from pay_order where id={$i}";
    $client->send($sql);//发送要执行的sql
    $data = $client->recv();//阻塞接受返回的结果
    var_dump($data);//打印
}
$client->close();//关闭连接